package com.schoolvisitors.exception;

import com.schoolvisitors.response.ResultCode;
import lombok.Getter;



public class ServiceException extends RuntimeException {
    @Getter
    private final int code;
    private final String message;
    @Getter
    private final ResultCode resultCode;

    public ServiceException(ResultCode resultCode) {
        this.resultCode = resultCode;
        this.code = resultCode.getCode();
        this.message = resultCode.getMessage();
    }

    @Override
    public String getMessage() {
        return message;
    }

}
